﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Common;

public partial class admin_finance_reportbuilding : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = -1;
        PageBegin();

        if (RequestBase.GetFormString("___EVENTTARGET") == "save")
        {
            SaveInfo();
        }

        if (!IsPostBack)
        {
            InitDateControl();
        }
    }


    #region 初始化日期控件
    /// <summary>
    /// 初始化日期控件
    /// </summary>
    void InitDateControl()
    {
        new BindControl().BindYearDropList(dropYear, false);
        dropYear.SelectedValue = DateTime.Now.Year.ToString();
    }
    #endregion 

    #region 信息处理
    void SaveInfo()
    {
        string result = "";

        result = BLL.LED.FinanceRecordBase.BuildingReport(int.Parse(dropYear.SelectedValue.Trim()), this.SystemUserId);

        if (result == "succeeded")
        {
            JScript.AlertAndReturnValueToParent("Update succeeded!", "window.dialogArguments.LoadingData();window.close();");
        }
        else
        {
            JScript.Alert(result);
            return;
        }
    }
    #endregion
}
